﻿using System;
using System.Collections.Generic;
using System.Text;
using Google.Protobuf;
using Cemit.PolyProto;

namespace Cemit.PolyServer.Game
{
    public class OperationHandle : IMessageHandle<O>
    {
        public void Execute(ClientState clientState, IMessage message)
        {
            //不处理未连接的请求
            if (!clientState.IsLogin)
            {
                this.Log("该玩家还未登录，传来的帧信息视为无效: " + clientState.player.ID);
                return;
            }

            O operation = this.AsMessage(message);
            GameServer.Instance.GetRoom(operation.RoomId)
                .AddOperation(clientState.player.ID, operation.Operation);
        }
    }
}
